home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CUCD / Programming / OUI / include / rcs / window.h < prev   
Encoding:
C/C++ Source or Header  |  1998-04-08  |  20.4 KB  |  868 lines

  1. head    1.5;
  2. access;
  3. symbols;
  4. locks
  5.     dlorre:1.5; strict;
  6. comment    @ * @;
  7.  
  8.  
  9. 1.5
  10. date    98.04.08.15.13.40;    author dlorre;    state Exp;
  11. branches;
  12. next    1.4;
  13.  
  14. 1.4
  15. date    98.01.13.20.03.07;    author dlorre;    state Exp;
  16. branches;
  17. next    1.3;
  18.  
  19. 1.3
  20. date    97.07.14.04.25.42;    author dlorre;    state Exp;
  21. branches;
  22. next    1.2;
  23.  
  24. 1.2
  25. date    96.08.28.20.08.00;    author dlorre;    state Exp;
  26. branches;
  27. next    1.1;
  28.  
  29. 1.1
  30. date    96.08.22.02.05.49;    author dlorre;    state Exp;
  31. branches;
  32. next    ;
  33.  
  34.  
  35. desc
  36. @Oui.lib -- Object User Interface
  37. Projet créé en 1994
  38. Auteur: Dominique Lorre
  39. @
  40.  
  41.  
  42. 1.5
  43. log
  44. @sname size enlarged
  45. @
  46. text
  47. @// $Id: window.h 1.4 1998/01/13 20:03:07 dlorre Exp dlorre $
  48. #if !defined( CLASS_WINDOW_H )
  49. #define CLASS_WINDOW_H 1
  50.  
  51.  
  52. #if !defined( EXEC_TYPES_H )
  53. #include <exec/types.h>
  54. #endif
  55.  
  56. #if !defined( GRAPHICS_TYPES_H )
  57. #include <graphics/gfxbase.h>
  58. #endif
  59.  
  60. #if !defined( GRAPHICS_GFXMACROS_H )
  61. #include <graphics/gfxmacros.h>
  62. #endif
  63.  
  64. #if !defined( INTUITION_GADGETCLASS_H )
  65. #include <intuition/gadgetclass.h>
  66. #endif
  67.  
  68. #if !defined( LIBRARIES_GADTOOLS_H )
  69. #include <libraries/gadtools.h>
  70. #endif
  71.  
  72. #ifndef CLASS_SLIST_H
  73. #include "slist.h"
  74. #endif
  75.  
  76. #include "rectangle.h"
  77. #include "screen.h"
  78. #include "locale.h"
  79.  
  80. #ifndef CLASS_GADGETLIST_H
  81. #include "gadgetlist.h"
  82. #endif
  83.  
  84. #ifndef CLASS_GADGET_H
  85. class window ;
  86. #include "gadgets/gadget.h"
  87. #endif
  88.  
  89. #ifndef CLASS_STRING_H
  90. #include "gadgets/string.h"
  91. #endif
  92.  
  93. #ifdef open
  94. #undef open
  95. #endif
  96.  
  97. #ifdef close
  98. #undef close
  99. #endif
  100.  
  101. class menustate {
  102. public:
  103.     MenuItem    *item ;
  104.     BOOL        enable ;
  105.     BOOL        checked ;
  106.     menustate() : item(NULL), enable(TRUE), checked(FALSE) {}
  107. } ;
  108.  
  109. class window ;
  110.  
  111. class wlink : public nlink
  112. {
  113. public:
  114.     window *win ;
  115. } ;
  116.  
  117. // ========================================================================
  118. // ========================== WINDOW CLASS ================================
  119. // ========================================================================
  120.  
  121.  
  122.  
  123. class window : public rectangle {
  124. friend class gadgetlist ;
  125. private:
  126.     TagItem     *tags ;
  127.     Region      *clipregion ;
  128.     Rectangle   *cliprect ;
  129.  
  130.     short       awidth ;
  131.     short       aheight ;
  132.     int         asize ;
  133.     WORD        *areaBuffer ;
  134.     UBYTE       *tmpBuffer;     // PLANEPTR
  135.     BitMap      *tmpBitMap ;
  136.     AreaInfo    *areaInfo ;
  137.     TmpRas      *tmpRas ;
  138.     short       drawmode ;
  139.     RastPort    *bgrp ;
  140.     BitMap      *bgbm ;
  141.     wlink       link ;
  142. protected:
  143.     gadgetlist  *g ;            // the gadgets attached to this window
  144.     void        (*reqfunc)(long, unsigned long, unsigned short) ;
  145.  
  146.     ULONG       idcmp ;         // the IDCMP flags
  147.     BOOL        hasgadgets ;    // window contains gadgets
  148.     BOOL        hasmenus ;      // window contains menus
  149.     BOOL        selfmsg ;       // the MsgPort is not shared
  150. public:
  151.     screen      *ws ;
  152.     Window      *win ;          // useful pointers
  153.     MsgPort     *mp ;
  154.     Menu        *menu ;
  155.     RastPort    *rp ;
  156.  
  157.     BOOL        active ;        // user did not request for closing
  158.     BOOL        initok ;        // open window succeeds
  159.     ULONG       signal ;        // the MsgPort signal bit
  160.  
  161.     char        sname[256] ;    // storage (name in dialog box)
  162.     BOOL        okflag ;        // user accept dialog box
  163.     BOOL        applique ;      // do the changes now
  164.     LONG        emode ;         // extended mode set to 1 if special action
  165. public:
  166.     window(short l, short t, short w, short h) ;
  167.     virtual ~window() ;
  168. protected:
  169.     // Standard Gadget Routines
  170.     virtual void fok(gadget *g, unsigned long classe, unsigned short code) ;
  171.     virtual void fcancel(gadget *g, unsigned long classe, unsigned short code) ;
  172.     virtual void fapply(gadget *g, unsigned long classe, unsigned short code) ;
  173.     virtual void fname(gadget *g, unsigned long classe, unsigned short code) ;
  174.     virtual void handlevkey(USHORT code) ;
  175.     virtual void handlerawkey(USHORT code) ;
  176.     virtual void handlemousebuttons(USHORT code, WORD x, WORD y, UWORD qualifier) ;
  177. public:
  178.     virtual void open(screen *) ;
  179.     virtual void close() ;
  180.     virtual void simpleevent(IntuiMessage *msg) ;
  181.     virtual void otext( long x, long y, const char *string ) ;
  182. protected:
  183.     void _open(MsgPort *, ULONG, ULONG, ...) ;
  184.     void _open(MsgPort *, ULONG, TagItem *) ;
  185.  
  186.     void strip() ;
  187.     void stripimsg() ;
  188.     void resetidcmp() ;
  189.  
  190. public:
  191.     void prepbox(BOOL center=FALSE) ;    // Initialization routine
  192.     void eventloop() ;
  193.     void processevents(IntuiMessage *msg) ;
  194.     void setfunc(void (*func)(long , unsigned long, unsigned short)) ;
  195.  
  196.     // Window management functions
  197.     void move(short dx, short dy=0) ;
  198.     void size(short dw, short dh=0) ;
  199.     void box(short x, short y, short w, short h) ;
  200.     void limits(short wmin, short hmin, short wmax, short hmax) ;
  201.     void titles(const char *wt, const char *st) ;
  202.     void activate() ;
  203.     void front() ;
  204.     void back() ;
  205.  
  206.     // Gadtools & Menus routines
  207.     void recessedbox(short x, short y, short w, short h) ;
  208.     void bevelbox(short x, short y, short w, short h) ;
  209.     void setmenus(struct NewMenu *menu1, ...) ;
  210.     void expandmenu(Menu *, NewMenu *extmenu) ;
  211.     void menuchanges(menustate *, LONG count) ;
  212.     MenuItem *itemaddress( unsigned long menuNumber ) ;
  213.     MenuItem *itemaddress(LONG m, LONG i, LONG s) ;
  214.     void clearmenustrip(void) ;
  215.     BOOL resetmenustrip(void) ;
  216.  
  217.     // Gfx routines
  218.     void pmove(long x, long y) ;                    // Move(rp, ...)
  219.     void draw(long x, long y) ;                     // Draw(rp, ...)
  220.     void polydraw(long count, WORD *polyTable) ;
  221.     void rectfill(long xMin, long yMin, long xMax, long yMax) ;
  222.     void eraserect(long xMin, long yMin, long xMax, long yMax ) ;
  223.     void setapen(unsigned long pen) ;
  224.     void setbpen(unsigned long pen) ;
  225.     void setopen(unsigned long pen) ;
  226.     void setrast(unsigned long pen) ;
  227.     void setdrmd(unsigned long drawMode) ;
  228.     void setdrpt(UWORD pattern) ;
  229.     void setafpt(const UWORD *pattern, BYTE count) ;
  230.     short textlength(const char *string, unsigned long count ) ;
  231.     void text( const char *string, unsigned long count ) ;
  232.     unsigned long textfit(const char *string, unsigned long strLen,
  233.         struct TextExtent *textExtent, struct TextExtent *constrainingExtent,
  234.         long strDirection, unsigned long constrainingBitWidth,
  235.         unsigned long constrainingBitHeight ) ;
  236.     void setfont(TextFont *font) ;
  237.  
  238.     // Intuition Drawing Routines
  239.     void printitext(IntuiText *iText, long left, long top ) ;
  240.     void drawborder( Border *border, long leftOffset, long topOffset ) ;
  241.     void drawimage( struct Image *image, long leftOffset, long topOffset ) ;
  242.     void eraseimage( struct Image *image, long leftOffset, long topOffset ) ;
  243.  
  244.     // Clip Routines
  245.     int newregion(void) ;
  246.     void disposeregion(void) ;
  247.     BOOL addregion(short l, short t, short w, short h) ;
  248.     void installclip(void) ;
  249.     void removeclip(void) ;
  250.  
  251.     // Pointer Routines
  252.     void setpointer( UWORD *pointer, long height,
  253.         long width, long xOffset, long yOffset ) ;
  254.     void clearpointer() ;
  255.  
  256.     // Area Routines
  257.     short initarea(short w, short h, int size=1000) ;
  258.     void freearea() ;
  259.     long areaellipse(long xCenter, long yCenter, long a, long b ) ;
  260.     long areamove( long x, long y ) ;
  261.     long areadraw( long x, long y ) ;
  262.     long areaend() ;
  263.     BOOL flood( unsigned long mode, long x, long y ) ;
  264.  
  265.     // BackGround Drawing routines
  266.     void setbgrp(RastPort *brp) ;
  267.     void clearbgrp() ;
  268.  
  269.     void flushbg(int x, int y, int w, int h, int mode=0xC0) ;
  270.  
  271.     // Refresh routines
  272.     void beginrefresh() ;
  273.     void endrefresh(BOOL end) ;
  274.     void refreshwindowframe() ;
  275.  
  276. } ;
  277.  
  278. inline void window::fok(gadget *g, unsigned long classe, unsigned short code)
  279. {
  280.     okflag = TRUE; active = FALSE ; emode = 0 ; applique = FALSE ;
  281. }
  282.  
  283. inline void window::fcancel(gadget *g, unsigned long classe, unsigned short code)
  284. {
  285.     okflag = FALSE; active = FALSE ; emode = 0 ; applique = FALSE ;
  286. }
  287.  
  288. inline void window::fapply(gadget *g, unsigned long classe, unsigned short code)
  289. {
  290.     okflag = TRUE; active = FALSE ; emode = 0 ; applique = TRUE ;
  291. }
  292.  
  293. inline void window::handlevkey(USHORT code)
  294. {
  295.     if (code == 0x0D) {
  296.         g->selectgadget(g->getcount()-2, FALSE) ;
  297.     }
  298.     else if (code == 0x1B) {
  299.         g->selectgadget(g->getcount()-1, FALSE) ;
  300.     }
  301.     else
  302.         g->parsegadgets(code) ;
  303. }
  304.  
  305. inline void window::handlerawkey(USHORT code)
  306. {
  307. }
  308.  
  309. inline void window::handlemousebuttons(USHORT code, WORD x, WORD y, UWORD qualifier)
  310. {
  311. }
  312.  
  313. #if !defined( CLASS_WINDOW_INLINES_H ) && !defined( NO_CLASS_WINDOW_INLINES )
  314. #include "window_inlines.h"
  315. #endif
  316.  
  317. typedef void (window::*WFUNC)(gadget *, unsigned long, unsigned short) ;
  318. #endif
  319.  
  320. @
  321.  
  322.  
  323. 1.4
  324. log
  325. @vanillakey handling changed
  326. @
  327. text
  328. @d1 1
  329. a1 1
  330. // $Id: window.h 1.3 1997/07/14 04:25:42 dlorre Exp dlorre $
  331. d115 1
  332. a115 1
  333.     char        sname[80] ;     // storage (name in dialog box)
  334. @
  335.  
  336.  
  337. 1.3
  338. log
  339. @many changes to inlined functions
  340. @
  341. text
  342. @d1 1
  343. a1 1
  344. // $Id: window.h 1.2 1996/08/28 20:08:00 dlorre Exp dlorre $
  345. d63 8
  346. d89 1
  347. d95 1
  348. d130 1
  349. a231 5
  350. inline window::~window()
  351. {
  352.     if (initok) close() ;
  353. }
  354.  
  355. d249 8
  356. d260 4
  357. @
  358.  
  359.  
  360. 1.2
  361. log
  362. @passage en INLINE de beaucoup de fonctions
  363. @
  364. text
  365. @d1 1
  366. a1 1
  367. // $Id$
  368. d6 1
  369. d8 3
  370. d12 3
  371. d16 3
  372. d20 3
  373. d24 1
  374. a24 2
  375. #include <stdio.h>
  376. #include <string.h>
  377. d29 1
  378. d42 1
  379. a45 6
  380. #include <cxxproto/exec.h>
  381. #include <cxxproto/graphics.h>
  382. #include <cxxproto/layers.h>
  383. #include <cxxproto/intuition.h>
  384. #include <cxxproto/gadtools.h>
  385. #include <cxxproto/utility.h>
  386. d47 7
  387. a93 33
  388.  
  389.     void _open(MsgPort *, ULONG, ULONG, ...) ;
  390.     void _open(MsgPort *, ULONG, TagItem *) ;
  391.  
  392.     void strip() ;
  393.     void stripimsg() ;
  394.     void resetidcmp() { ModifyIDCMP(win, idcmp) ; }
  395.  
  396.     void prepbox(BOOL center=FALSE) ;    // Initialization routine
  397.  
  398.     // Standard Gadget Routines
  399.     virtual void fok(gadget *g, unsigned long classe, unsigned short code)
  400.     {
  401.         okflag = TRUE; active = FALSE ; emode = 0 ; applique = FALSE ;
  402.     }
  403.  
  404.     virtual void fcancel(gadget *g, unsigned long classe, unsigned short code)
  405.     {
  406.         okflag = FALSE; active = FALSE ; emode = 0 ; applique = FALSE ;
  407.     }
  408.  
  409.     virtual void fapply(gadget *g, unsigned long classe, unsigned short code)
  410.     {
  411.         okflag = TRUE; active = FALSE ; emode = 0 ; applique = TRUE ;
  412.     }
  413.  
  414.     virtual void fname(gadget *g, unsigned long classe, unsigned short code)
  415.     {
  416.         strcpy(sname, ((string *)g)->curstring) ;
  417.     }
  418.  
  419.     virtual void handlevkey(USHORT code) {}
  420.     virtual void handlerawkey(USHORT code) {}
  421. d109 1
  422. a109 1
  423.  
  424. d111 10
  425. a120 2
  426.     virtual ~window() { if (initok) close() ; }
  427.  
  428. d123 9
  429. d133 2
  430. d137 1
  431. a137 1
  432.     virtual void simpleevent(IntuiMessage *msg) ;
  433. d139 9
  434. a147 44
  435.     void setfunc(void (*func)(long , unsigned long, unsigned short))
  436.     {
  437.         reqfunc = func ;
  438.     }
  439.  
  440.     void move(short dx, short dy=0)
  441.     {
  442.         rectangle::move(dx, dy) ;
  443.         if (win) ChangeWindowBox(win, left, top, width, height) ;
  444.     }
  445.     void size(short dw, short dh=0)
  446.     {
  447.         rectangle::size(dw, dh) ;
  448.         if (win) ChangeWindowBox(win, left, top, width, height) ;
  449.     }
  450.     void box(short x, short y, short w, short h)
  451.     {
  452.         rectangle::box(x, y, w, h) ;
  453.         if (win) ChangeWindowBox(win, left, top, width, height) ;
  454.     }
  455.  
  456.  
  457.     void limits(short wmin, short hmin, short wmax, short hmax)
  458.     {
  459.         rectangle::limits(wmin, hmin, wmax, hmax) ;
  460.         if (win) WindowLimits(win, minw, minh, maxw, maxh) ;
  461.     }
  462.  
  463.     void titles(STRPTR wt, STRPTR st)
  464.     {
  465.         if (win) SetWindowTitles(win, wt, st) ;
  466.     }
  467.     void activate()
  468.     {
  469.         if (win) ActivateWindow(win) ;
  470.     }
  471.     void front()
  472.     {
  473.         if (win) WindowToFront(win) ;
  474.     }
  475.     void back()
  476.     {
  477.         if (win) WindowToBack(win) ;
  478.     }
  479. d150 2
  480. a151 16
  481.  
  482.     void recessedbox(short x, short y, short w, short h)
  483.     {
  484.         if (win)
  485.             DrawBevelBox(rp, x, y, w, h,
  486.             GT_VisualInfo, ws->vi,
  487.             GTBB_Recessed, TRUE,
  488.             TAG_END);
  489.     }
  490.     void bevelbox(short x, short y, short w, short h)
  491.     {
  492.         if (win)
  493.             DrawBevelBox(rp, x, y, w, h,
  494.             GT_VisualInfo, ws->vi,
  495.             TAG_END);
  496.     }
  497. d155 4
  498. a158 8
  499.     MenuItem *itemaddress( unsigned long menuNumber )
  500.     {
  501.         return ItemAddress( menu, menuNumber) ;
  502.     }
  503.     MenuItem *itemaddress(LONG m, LONG i, LONG s)
  504.     {
  505.         return ItemAddress(menu, FULLMENUNUM(m, i, s)) ;
  506.     }
  507. d161 15
  508. a175 59
  509.  
  510.     void pmove(long x, long y)                      // Move(rp, ...)
  511.     {
  512.         Move(rp, x, y) ;
  513.     }
  514.     void draw(long x, long y)                       // Draw(rp, ...)
  515.     {
  516.         Draw(rp, x, y) ;
  517.     }
  518.     void polydraw(long count, WORD *polyTable)
  519.     {
  520.         PolyDraw(rp, count, polyTable) ;
  521.     }
  522.     void rectfill(long xMin, long yMin, long xMax, long yMax)
  523.     {
  524.         RectFill(rp, xMin, yMin, xMax, yMax) ;
  525.     }
  526.     void eraserect(long xMin, long yMin, long xMax, long yMax )
  527.     {
  528.         EraseRect(rp, xMin, yMin, xMax, yMax) ;
  529.     }
  530.     void setapen(unsigned long pen)
  531.     {
  532.         SetAPen(rp, pen) ;
  533.     }
  534.     void setbpen(unsigned long pen)
  535.     {
  536.         SetBPen(rp, pen) ;
  537.     }
  538.     void setopen(unsigned long pen)
  539.     {
  540.         SafeSetOutlinePen(rp, char(pen)) ;
  541.     }
  542.     void setrast(unsigned long pen)
  543.     {
  544.         SetRast(rp, pen) ;
  545.     }
  546.     void setdrmd(unsigned long drawMode)
  547.     {
  548.         SetDrMd(rp, drawMode) ;
  549.     }
  550.     void setdrpt(unsigned short pattern)
  551.     {
  552.         SetDrPt(rp, pattern) ;
  553.     }
  554.     short textlength(STRPTR string, unsigned long count )
  555.     {
  556.         return TextLength(rp, string, count );
  557.     }
  558.     void text( STRPTR string, unsigned long count )
  559.     {
  560.         Text(rp, string, count) ;
  561.     }
  562.     virtual void otext( long x, long y, STRPTR string )
  563.     {
  564.         pmove(x, y) ;
  565.         text(string, strlen(string)) ;
  566.     }
  567.     unsigned long textfit(STRPTR string, unsigned long strLen,
  568. d178 2
  569. a179 10
  570.         unsigned long constrainingBitHeight )
  571.     {
  572.         return TextFit(rp, string, strLen, textExtent, constrainingExtent,
  573.             strDirection, constrainingBitWidth, constrainingBitHeight) ;
  574.     }
  575.     void setfont(TextFont *font)
  576.     {
  577.         SetFont( rp, font) ;
  578.     }
  579.  
  580. d182 4
  581. a185 16
  582.     void printitext(IntuiText *iText, long left, long top )
  583.     {
  584.         PrintIText( rp, iText, left, top) ;
  585.     }
  586.     void drawborder( Border *border, long leftOffset, long topOffset )
  587.     {
  588.         DrawBorder( rp, border, leftOffset, topOffset );
  589.     }
  590.     void drawimage( struct Image *image, long leftOffset, long topOffset )
  591.     {
  592.         DrawImage( rp, image, leftOffset, topOffset );
  593.     }
  594.     void eraseimage( struct Image *image, long leftOffset, long topOffset )
  595.     {
  596.         EraseImage( rp, image, leftOffset,  topOffset );
  597.     }
  598. d188 5
  599. a192 28
  600.     int newregion(void)
  601.     {
  602.         clipregion = NewRegion() ;
  603.         if (clipregion)
  604.             cliprect = new Rectangle ;
  605.         return (clipregion != NULL) ;
  606.     }
  607.     void disposeregion(void)
  608.     {
  609.         delete cliprect ;
  610.         DisposeRegion( clipregion );
  611.     }
  612.     void addregion(short l, short t, short w, short h)
  613.     {
  614.         cliprect->MinX = l ;
  615.         cliprect->MaxX = short(l+w) ;
  616.         cliprect->MinY = t ;
  617.         cliprect->MaxY = short(t+h) ;
  618.         OrRectRegion(clipregion, cliprect) ;
  619.     }
  620.     void installclip(void)
  621.     {
  622.         InstallClipRegion(win->WLayer, clipregion) ;
  623.     }
  624.     void removeclip(void)
  625.     {
  626.         clipregion = InstallClipRegion(win->WLayer, NULL) ;
  627.     }
  628. d196 2
  629. a197 8
  630.         long width, long xOffset, long yOffset )
  631.     {
  632.         SetPointer(win, pointer, height, width, xOffset, yOffset) ;
  633.     }
  634.     void clearpointer()
  635.     {
  636.         ClearPointer(win) ;
  637.     }
  638. d202 5
  639. a206 20
  640.     long areaellipse(long xCenter, long yCenter, long a, long b )
  641.     {
  642.         return AreaEllipse( rp, xCenter, yCenter, a, b ) ;
  643.     }
  644.     long areamove( long x, long y )
  645.     {
  646.         return AreaMove( rp, x, y );
  647.     }
  648.     long areadraw( long x, long y )
  649.     {
  650.         return AreaDraw( rp, x, y );
  651.     }
  652.     long areaend()
  653.     {
  654.         return AreaEnd( rp );
  655.     }
  656.     BOOL flood( unsigned long mode, long x, long y )
  657.     {
  658.         return Flood( rp, mode, x, y );
  659.     }
  660. d208 3
  661. d212 1
  662. a212 12
  663.     // BackGround Drawing routines
  664.     void setbgrp(RastPort *brp)
  665.     {
  666.         rp = bgrp = brp ;
  667.         bgbm = bgrp->BitMap ;
  668.     }
  669.     void clearbgrp() { rp = win->RPort ; }
  670.  
  671.     void flushbg(int x, int y, int w, int h, int mode=0xC0)
  672.     {
  673.         BltBitMapRastPort(bgbm, 0, 0, win->RPort, x, y, w, h, mode);
  674.     }
  675. d215 3
  676. a217 12
  677.     void beginrefresh()
  678.     {
  679.         GT_BeginRefresh(win) ;
  680.     }
  681.     void endrefresh(BOOL end)
  682.     {
  683.         GT_EndRefresh(win, end) ;
  684.     }
  685.     void refreshwindowframe()
  686.     {
  687.         RefreshWindowFrame(win) ;
  688.     }
  689. d221 27
  690. a247 5
  691. class winnode : public slink {
  692. public:
  693.     window  *wptr ;
  694.     long    type ;      // window's kind
  695. };
  696. d249 3
  697. a252 4
  698. class winlist : public slist {
  699. public:
  700.     void dumplist() ;
  701. };
  702. @
  703.  
  704.  
  705. 1.1
  706. log
  707. @Initial revision
  708. @
  709. text
  710. @d1 1
  711. a4 34
  712. #if !defined( EXEC_PORTS_H )
  713. struct MsgPort ;
  714. #endif
  715.  
  716. #if !defined( GRAPHICS_RASTPORT_H )
  717. struct RastPort ;
  718. struct AreaInfo ;
  719. struct TmpRas ;
  720. #endif
  721.  
  722. #if !defined( GRAPHICS_GFX_H )
  723. struct Rectangle ;
  724. struct BitMap ;
  725. #endif
  726.  
  727. #if !defined( GRAPHICS_REGIONS_H )
  728. struct Region ;
  729. #endif
  730.  
  731.  
  732. #if !defined( GRAPHICS_TEXT_H )
  733. struct TextExtent ;
  734. struct TextFont ;
  735. #endif
  736.  
  737. #if !defined( INTUITION_INTUITION_H )
  738. struct Window ;
  739. struct Menu ;
  740. struct MenuItem ;
  741. struct IntuiMessage ;
  742. struct Image ;
  743. struct Border ;
  744. struct IntuiText ;
  745. #endif
  746. d6 7
  747. a12 7
  748. #if !defined( LIBRARIES_GADTOOLS_H )
  749. struct NewMenu ;
  750. #endif
  751.  
  752. #if !defined( UTILITY_TAGITEM_H )
  753. struct TagItem ;
  754. #endif
  755. d14 1
  756. a14 1
  757. #if !defined( CLASS_SLIST_H )
  758. a16 2
  759.  
  760. #if !defined( CLASS_RECTANGLE_H )
  761. d18 2
  762. a19 1
  763. #endif
  764. d21 2
  765. a22 2
  766. #if !defined( CLASS_SCREEN_H )
  767. class screen ;
  768. d25 13
  769. a37 3
  770. #if !defined( CLASS_GADGETLIST_H )
  771. #include "gadgetlist.h"
  772. #endif
  773. d85 1
  774. a85 1
  775.     void resetidcmp() ;
  776. d90 19
  777. a108 4
  778.     virtual void fok(gadget *g, unsigned long classe, unsigned short code) ;
  779.     virtual void fcancel(gadget *g, unsigned long classe, unsigned short code) ;
  780.     virtual void fapply(gadget *g, unsigned long classe, unsigned short code) ;
  781.     virtual void fname(gadget *g, unsigned long classe, unsigned short code) ;
  782. d110 2
  783. a111 2
  784.     virtual void handlevkey(USHORT code) ;
  785.     virtual void handlerawkey(USHORT code) ;
  786. d126 1
  787. a126 1
  788.     int         emode ;         // extended mode set to 1 if special action
  789. d138 44
  790. a181 11
  791.     void setfunc(void (*func)(long , unsigned long, unsigned short)) ;
  792.  
  793.     void move(short dx, short dy=0) ;
  794.     void size(short dw, short dh=0) ;
  795.     void box(short x, short y, short w, short h) ;
  796.     void limits(short minw, short minh, short maxw, short maxh) ;
  797.  
  798.     void titles(STRPTR, STRPTR) ;
  799.     void activate() ;
  800.     void front() ;
  801.     void back() ;
  802. d185 15
  803. a199 2
  804.     void recessedbox(short x, short y, short w, short h) ;
  805.     void bevelbox(short x, short y, short w, short h) ;
  806. d203 8
  807. a210 2
  808.     MenuItem *itemaddress( unsigned long menuNumber );
  809.     MenuItem *itemaddress(LONG m, LONG i, LONG s) ;
  810. d214 57
  811. a270 14
  812.     void pmove(long x, long y) ;                    // Move(rp, ...)
  813.     void draw(long x, long y) ;                     // Draw(rp, ...)
  814.     void polydraw(long count, WORD *polyTable) ;
  815.     void rectfill(long xMin, long yMin, long xMax, long yMax) ;
  816.     void eraserect(long xMin, long yMin, long xMax, long yMax );
  817.     void setapen(unsigned long pen) ;
  818.     void setbpen(unsigned long pen) ;
  819.     void setopen(unsigned long pen) ;
  820.     void setrast(unsigned long pen) ;
  821.     void setdrmd(unsigned long drawMode) ;
  822.     void setdrpt(unsigned short pattern) ;
  823.     short textlength(STRPTR string, unsigned long count );
  824.     void text( STRPTR string, unsigned long count );
  825.     virtual void otext( long x, long y, STRPTR string );
  826. d274 9
  827. a282 2
  828.         unsigned long constrainingBitHeight );
  829.     void setfont(TextFont *) ;
  830. d286 16
  831. a301 4
  832.     void printitext(IntuiText *iText, long left, long top );
  833.     void drawborder( Border *border, long leftOffset, long topOffset );
  834.     void drawimage( struct Image *image, long leftOffset, long topOffset );
  835.     void eraseimage( struct Image *image, long leftOffset, long topOffset );
  836. d304 28
  837. a331 5
  838.     int newregion(void) ;
  839.     void disposeregion(void) ;
  840.     void addregion(short l, short t, short w, short h) ;
  841.     void installclip(void);
  842.     void removeclip(void) ;
  843. d335 8
  844. a342 2
  845.         long width, long xOffset, long yOffset );
  846.     void clearpointer() ;
  847. d347 21
  848. a367 5
  849.     long areaellipse(long xCenter, long yCenter, long a, long b );
  850.     long areamove( long x, long y );
  851.     long areadraw( long x, long y );
  852.     long areaend();
  853.     BOOL flood( unsigned long mode, long x, long y );
  854. d370 11
  855. a380 3
  856.     void setbgrp(RastPort *brp) ;
  857.     void clearbgrp() ;
  858.     void flushbg(int x, int y, int w, int h, int mode=0xC0) ;
  859. d383 12
  860. a394 3
  861.     void beginrefresh() ;
  862.     void endrefresh(BOOL) ;
  863.     void refreshwindowframe() ;
  864. a410 2
  865.  
  866.  
  867. @
  868.